/**
 * 
 */
package ControlLayer;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;

import ModelLayer.Product;
import ModelLayer.Supplier;
import ModelLayer.SupplierOrder;
import ModelLayer.Enums.OrderStatus;

/**
 * @author Frank Eskelund
 * @version
 */
public class SupplierOrderCtr {
	private ProductCtr productCtr;

	public SupplierOrderCtr() {
		productCtr = new ProductCtr();
	}
	
	public ArrayList<Product> generateSupplierOrder()
	{
		
		return productCtr.findLowInStock();
	}
	
	
	public void setSupplierOrderStatus(OrderStatus status, Date estimatedInStock, int amount, Product product)
	{
		SupplierOrder supplierOrder = new SupplierOrder(status, estimatedInStock, amount);
		product.addSupplierOrder(supplierOrder);
		productCtr.UpdateProduct(product);
	}
}
